import axios from './axios'
import resfulParamsToUrl from './resfulParamsToUrl'

// 机构添加
export const orgInsert = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/torgdict/insert', params), params)
		.catch(() => {})
}

// 树形机构查询
export const getOrgTreeList = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/torgdict/getDtoList', params), params)
		.catch(() => {})
}

// 机构查询
export const getOrgList = params => {
	axios.prototype._loading_ = false
	return axios
		.post(resfulParamsToUrl('/sys/auth/torgdict/getList', params), params)
		.catch(() => {})
}

// 获取机构
export const getUserOrgList = params => {
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/torgdict/getUserOrgList', params),
			params,
		)
		.catch(() => {})
}

// 医院机构查询
export const getOrgHospitalList = params => {
	axios.prototype._loading_ = false
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/torgdict/getHospitalList', params),
			params,
		)
		.catch(() => {})
}

// 机构删除
export const deleteOrg = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/torgdict/delete', params), params)
		.catch(() => {})
}

// 机构修改
export const updateOrg = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/torgdict/update', params), params)
		.catch(() => {})
}
// 机构管理编辑
export const getModel = params => {
	axios.prototype._loading_ = false
	return axios
		.post(resfulParamsToUrl('/sys/auth/torgdict/getModel', params), params)
		.catch(() => {})
}
// 机构

export const getList = params => {
	axios.prototype._loading_ = false
	return axios
		.post(resfulParamsToUrl('/sys/auth/tsysdatadict/getList', params), params)
		.catch(() => {})
}
// 机构编辑
export const findVOByVO = params => {
	axios.prototype._loading_ = false
	return axios
		.post(resfulParamsToUrl('/sys/auth/torgdict/findVOByVO', params), params)
		.catch(() => {})
}
// 机构名称校验

export const orgCodeCheck = params => {
	axios.prototype._show_error_ = false
	axios.prototype._loading_ = false
	return axios.post(
		resfulParamsToUrl('/sys/auth/torgdict/orgCodeCheck', params),
		params,
	)
}
// 原机构唯一校验
export const primaryOrgCodeCheck = params => {
	axios.prototype._show_error_ = false
	axios.prototype._loading_ = false
	return axios.post(
		resfulParamsToUrl('/sys/auth/torgdict/primaryOrgCodeCheck', params),
		params,
	)
}
// 重复校验
export const codeCheck = params => {
	axios.prototype._show_error_ = false
	axios.prototype._loading_ = false
	return axios.post(
		resfulParamsToUrl('/sys/auth/torgdict/codeCheck', params),
		params,
	)
}

//科室分页查询
export const getDeptPageList = params => {
	return axios.post(
		resfulParamsToUrl('/sys/auth/torgdict/pageList', params),
		params,
	)
}
